package com.david.iagent;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;

public class Splash extends Activity{
	
	protected int _splashTime = 3000;//3 seconds
    private Thread splashTread;
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.slpash_screen);
        splashTread = new Thread() {
            @SuppressWarnings("finally")
			@Override
            public void run() {
                try {
                    synchronized(this){

                            wait(_splashTime);
                    }

                } catch(InterruptedException e) {}
                finally {
                    finish();
                	Log.i("in the thread","finished");
                    //start a new activity
                    Intent i = new Intent(Splash.this, Login.class);
                    startActivity(i);
                    
                    return;
                }
            }
        };
        splashTread.start();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.slpash_screen, menu);
        return true;
    }

    
}
